package model;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


import java.awt.CardLayout;
import java.util.ArrayList;
import java.util.Vector;

/**
 *
 * @author asus-pc
 */
public class Shop {
    public ArrayList <Shopitem>arr=new ArrayList<>();
    //public Vector column=new Vector();
    public Vector title=new Vector();
    int flag=0;
    
    public boolean login(String name,String password,CardLayout card){
        return name.equals(password);
    }
    
    public void setproduct() {
    	arr.add(new Shopitem(1,"T恤",50));
    	arr.add(new Shopitem(2,"牛仔裤",60));
    	arr.add(new Shopitem(3,"毛衣",70));
    	arr.add(new Shopitem(4,"连衣裙",80));
    	arr.add(new Shopitem(5,"汉服",90));
        arr.add(new Shopitem(6,"衬衫",45));
        arr.add(new Shopitem(7,"吊带裙",109));
        arr.add(new Shopitem(8,"字帖",15));
        
        
        arr.add(new Shopitem(1,"《安娜·卡列尼娜》",55));
	arr.add(new Shopitem(2,"《鲁滨逊漂流记》",65));
	arr.add(new Shopitem(3,"《歌剧魅影》",541));
	arr.add(new Shopitem(4,"《边城》",179));
	arr.add(new Shopitem(5,"《指环王》",1590));
        arr.add(new Shopitem(6,"《活着》",32));
        arr.add(new Shopitem(7,"《培根随笔》",35));
        

    }
    
     public Vector addproduct(){
            Vector row=new Vector();
            row.add(arr.get(flag).getId());
            row.add(arr.get(flag).getName());
            row.add(arr.get(flag).getPrice());
            flag++;
         return row;    
        
       
    }
     
     public Vector title(){
         title.add("编号");
         title.add("商品名称");
         title.add("价格");
         return title;
     }
}
